﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Cepik
{
    public partial class MainMenu : Form
    {
        DodanieOsoby dodanieosoby;

        public MainMenu()
        {
            InitializeComponent();
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            BazaDanychDataSet1.OsobaDataTable osoby = new BazaDanychDataSet1.OsobaDataTable();
            BazaDanychDataSet1TableAdapters.OsobaTableAdapter osobyadapter = 
                new BazaDanychDataSet1TableAdapters.OsobaTableAdapter();

            osobyadapter.Fill(osoby);

            this.listBox1.Items.Clear();
            foreach (DataRow record in osoby.Rows)
            {
                this.listBox1.Items.Add(record[1].ToString()+" "+record[2].ToString());
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
           
        }

        private void button2_Click(object sender, EventArgs e)
        {
            dodanieosoby = new DodanieOsoby();
            dodanieosoby.ShowDialog();
            dodanieosoby.Dispose();
        }
    }
}
